//
//  XYJLXResultModel.m
//  徙游记-01
//
//  Created by hcios on 2017/7/13.
//  Copyright © 2017年 鹿林. All rights reserved.
//

#import "XYJLXResultModel.h"

@implementation XYJLXResultModel

-(instancetype)initWithDict:(NSDictionary *)dict{
    
    if (self = [super init]) {
        _comment_description = NonEmptyString(dict[@"description"]);
        _trip_id = numberToString(dict[@"trip"][@"id"]);
        _trip_name = NonEmptyString(dict[@"trip"][@"name"]);
        _trip_days = numberToString(dict[@"trip"][@"days"]);
        _trip_start_date = NonEmptyString(dict[@"trip"][@"start_date"]);
        _trip_photos_count = numberToString(dict[@"trip"][@"photos_count"]);
        _front_cover_photo_url = NonEmptyString(dict[@"trip"][@"front_cover_photo_url"]);
        _user_id = numberToString(dict[@"trip"][@"user"][@"id"]);
        _user_name = NonEmptyString(dict[@"trip"][@"user"][@"name"]);
        _user_image = NonEmptyString(dict[@"trip"][@"user"][@"image"]);
    }
    return self;
}


-(instancetype)initWithOtherDict:(NSDictionary *)dict{
    if (self = [super init]) {
        _notes_width = numberToString(dict[@"width"]);
        _notes_height = numberToString(dict[@"height"]);
        _note_photo_url = NonEmptyString(dict[@"photo_url"]);
    }
    return self;
}

@end
